package Test.D4;


public class BookListTable {
    
    public static void main(String[] args) {
        
        BookListTable book = new BookListTable();

        book.add(new BookListTable.BookList("信息","xx","ddddd"));

        book.del(0);
    }

    static class BookList
    {
        public String mName,mZ,mJ;
        public BookList(String name,String z,String j)
        {
            mName = name;
            mZ = z;
            mJ = j;
        }
    }

    final int MaxSize = 100;
    private BookList[] mBookLists = new BookList[MaxSize];

    public void add(BookList b)
    {
        for(int i=0;i<mBookLists.length;i++)
        {
            if(mBookLists[i]==null)
            {
                mBookLists[i] = b;
                return;
            }
        }
    }

    public void del(int num)
    {
        for(int i=num;i<mBookLists.length-1;i++)
        {
            mBookLists[i] = mBookLists[i+1];
        }
        mBookLists[mBookLists.length-1] = null;
    }

    public void del()
    {
        for(int i=0;i<mBookLists.length;i++)
        {
            mBookLists[i] = null;
        }
    }

    public BookList get(int i)
    {
        return  mBookLists[i];
    }

    public BookList[] get()
    {
        return  mBookLists;
    }
}
